
<template>
    <el-input v-model="text" placeholder="Please input something todo" style="width:210px"></el-input>
    <el-button @click="addTodo">Add Todo</el-button>
</template>
  
<script setup>
import { useTodolistStore } from '@/stores/todoList'
import { ref } from 'vue'

const todolistStore = useTodolistStore()
const text = ref('')
const addTodo = () => {
    todolistStore.addTodo(text.value)
    text.value = ''
}
</script>

<style scoped lang="scss">
a {
    margin-right: 10px;
}
</style>